package com.genexususa.eo.google;

import com.genexususa.eo.google.connection.CampaignManager;

/**
 * Created with IntelliJ IDEA.
 * User: dcogorno
 * Date: 18/02/13
 * Time: 01:27 PM
 * To change this template use File | Settings | File Templates.
 */
public class Test {
    public static void main(String[] args) {
        String xml = "<GA_Campaign xmlns=\"L2TMediaDevKB\">\n" +
                "\t<Account>\n" +
                "\t\t<Name>name</Name>\n" +
                "\t\t<Login>login</Login>\n" +
                "\t\t<CompanyName>company name</CompanyName>\n" +
                "\t\t<CustomerId>1</CustomerId>\n" +
                "\t\t<CanManageClients>false</CanManageClients>\n" +
                "\t\t<CurrencyCode>currency code</CurrencyCode>\n" +
                "\t\t<DateTimeZone>date time zone</DateTimeZone>\n" +
                "\t</Account>\n" +
                "\t<Budgets>\n" +
                "\t\t<Budget>\n" +
                "\t\t\t<Id>0</Id>\n" +
                "\t\t\t<Name>Budget10</Name>\n" +
                "\t\t\t<Period>D</Period>\n" +
                "\t\t\t<Amount>575.00</Amount>\n" +
                "\t\t\t<DeliveryMethod>S</DeliveryMethod>\n" +
                "\t\t\t<Status/>\n" +
                "\t\t\t<Shared>false</Shared>\n" +
                "\t\t\t<SubCampaigns>\n" +
                "\t\t\t\t<SubCampaign>\n" +
                "\t\t\t\t\t<Id>0</Id>\n" +
                "\t\t\t\t\t<SubCampaignGXId>0</SubCampaignGXId>\n" +
                "\t\t\t\t\t<Name>Mica Mpaign</Name>\n" +
                "\t\t\t\t\t<Status>A</Status>\n" +
                "\t\t\t\t\t<ServingStatus/>\n" +
                "\t\t\t\t\t<StartDate>2013-04-05</StartDate>\n" +
                "\t\t\t\t\t<EndDate>2013-05-19</EndDate>\n" +
                "\t\t\t\t\t<BiddingStrategy>\n" +
                "\t\t\t\t\t\t<BSBudgetOptimizer>\n" +
                "\t\t\t\t\t\t\t<enhancedCpcEnabled>true</enhancedCpcEnabled>\n" +
                "\t\t\t\t\t\t\t<bidCeiling>231.00</bidCeiling>\n" +
                "\t\t\t\t\t\t</BSBudgetOptimizer>\n" +
                "\t\t\t\t\t</BiddingStrategy>\n" +
                "\t\t\t\t\t<AdServingOptimizationStatus>C</AdServingOptimizationStatus>\n" +
                "\t\t\t\t\t<FrequencyCap>\n" +
                "\t\t\t\t\t\t<FreqImpressions>7</FreqImpressions>\n" +
                "\t\t\t\t\t\t<FreqLevel>A</FreqLevel>\n" +
                "\t\t\t\t\t\t<FreqTimeUnit>D</FreqTimeUnit>\n" +
                "\t\t\t\t\t</FrequencyCap>\n" +
                "\t\t\t\t\t<Settings>\n" +
                "\t\t\t\t\t\t<GeoTargetTypeSetting>\n" +
                "\t\t\t\t\t\t\t<GeoTargetPositiveType>A</GeoTargetPositiveType>\n" +
                "\t\t\t\t\t\t\t<GeoTargetNegativeType>D</GeoTargetNegativeType>\n" +
                "\t\t\t\t\t\t</GeoTargetTypeSetting>\n" +
                "\t\t\t\t\t\t<KeywordMatch>\n" +
                "\t\t\t\t\t\t\t<match>true</match>\n" +
                "\t\t\t\t\t\t</KeywordMatch>\n" +
                "\t\t\t\t\t\t<RealTimeBidding>\n" +
                "\t\t\t\t\t\t\t<realtime>true</realtime>\n" +
                "\t\t\t\t\t\t</RealTimeBidding>\n" +
                "\t\t\t\t\t\t<TargetRestrict>\n" +
                "\t\t\t\t\t\t\t<UseAdGroup>true</UseAdGroup>\n" +
                "\t\t\t\t\t\t</TargetRestrict>\n" +
                "\t\t\t\t\t</Settings>\n" +
                "\t\t\t\t\t<NetworkSetting>\n" +
                "\t\t\t\t\t\t<NetworkGoogleSearch>true</NetworkGoogleSearch>\n" +
                "\t\t\t\t\t\t<NetworkSearchNetwork>true</NetworkSearchNetwork>\n" +
                "\t\t\t\t\t\t<NetworkContentNetwork>true</NetworkContentNetwork>\n" +
                "\t\t\t\t\t\t<NetworkPartnerSearchNetwork>true</NetworkPartnerSearchNetwork>\n" +
                "\t\t\t\t\t</NetworkSetting>\n" +
                "\t\t\t\t</SubCampaign>\n" +
                "\t\t\t</SubCampaigns>\n" +
                "\t\t</Budget>\n" +
                "\t</Budgets>\n" +
                "</GA_Campaign>";
        CampaignManager campaignManager = new CampaignManager();
        campaignManager.SetClientId("2040701763");
        String res = campaignManager.CreateCampaign(xml);
        System.out.println(res);
    }
}
